﻿using UnityEngine;

namespace GameFramework.common
{
    public class GameObjectUtil
    {
        public static GameObject find(string parentName,string name)
        {
            GameObject pObj = GameObject.Find(parentName);
            if (pObj == null)
            {
                return null;
            }

            int childCount = pObj.transform.childCount;
            for (int i = 0; i < childCount; i++)
            {
                Transform transform = pObj.transform.GetChild(i);
                if (transform.name.Equals(name))
                {
                    return transform.gameObject;
                }
            }

            return null;
        }
    }
}